<?php e($javascript->link('ckeditor/ckeditor')); ?>
<div class="posts form">
<?php e($form->create('Post', array('enctype'=>'multipart/form-data'))); ?>
    <fieldset>
         <legend><?php __('Edit Post'); ?></legend>
        <!-- Post Add form left column -->
        <div class="widfats">
            <?php e($form->hidden('id')); ?>
            <?php e($form->hidden('user_id')); ?>
            <?php e($form->input('title', array(
                'label'=>__('PostTitle', true),
                'class' => 'text input large',
                'autocomplete'=>'off'))); ?>
            <?php e($form->input('content', array(
                'label'=>__('PostContent', true),
                'type'=>'textarea',
                'class' => 'textarea',
                'title'=>'公告内容'))); ?>
        </div>
        <!-- Post add sidebar -->
        <div class="sidebar">
            <!-- Action Buttons -->
            <div class="widget">
                <div class="toggle">&nbsp;</div>
                <h3 class="handle"><?php __('Quick Actions'); ?></h3>
                <div class="content">
                    <?php e($form->submit(__('Update Post', true), array('class' =>'submit'))); ?>
                    <div class="actions">
                        <ul>
                            <li><?php e($html->link(
                                __('Preview Post', true),
                                array('controller'=>'posts','action'=>'view',$id))); ?>
                            </li>
                            <li><?php e($html->link(
                                __('Posts', true),
                                array('controller'=>'posts','action'=>'index'))); ?>
                            </li>
                            <br class="clear"/>
                        </ul>
                    </div>
                </div>
            </div>
            <!-- Post Terms -->
            <div class="widget">
                <div class="toggle">&nbsp;</div>
                <h3 class="handle"><?php __('PostTerm'); ?></h3>
                <div class="content">
                    <?php e($form->input('post_term_id', array(
                        'label'=>__('PostTerm', true),
                        'class'=>'select',
                        'empty' => __('-Post Term-', true)))); ?>
                    <br class="clear"/>
                    <p>
                        <?php __('What is PostTerm?'); ?>
                        <a href="javascript:void(0)" id="DescribePostTerm"><?php __('View Help'); ?></a>
                    </p>
                    <p id="DescribePostTermPara" class="faq">公告栏目是根据公告内容来确定的, 比如说"就业指导"栏目下面的公告都是讲解相关就业的, 如宣讲会通知, 招聘会通知等.</p>
                    <p>
                        <?php __('No suitable PostTerm?'); ?>
                        <?php e($html->link(__('Add PostTerm', true), array('controller'=>'post_terms', 'action'=>'add'))); ?>
                    </p>
                </div>
            </div>
            <!-- Post Attachments -->
            <div class="widget">
                <div class="toggle">&nbsp;</div>
                <h3 class="handle"><?php __('Post Attachment'); ?></h3>
                <div class="content">
                    <?php e($this->element('attachments', array('plugin' => 'media'))); ?>
                </div>
            </div>
        </div>
    </fieldset>
<?php e($form->end()); ?>
</div>

<script type='text/javascript'>
$(window).ready(function(){
    // Justify attachment delete labels
    $('label[for$=Delete]').addClass('checkbox');
    // Create an CKEditor
    $.sme.cbk.initCKEditor('PostContent');
    // Bind PostTermDescribe toggle
    $('a#DescribePostTerm').click(function(){
        $('p#DescribePostTermPara').toggle();
    }).click();
});
</script>
